<!DOCTYPE html>
<html>
{{template "inc_bodyHead" ""}}
<body>

{{template "inc_header" .}}

<div id="main">
    <div id="main-inner">

        <div class="clouds">
            <h3 class="clouds-title">文章归档</h3>
            <div id="archive-cloud">
                {{range .Data.Lists}}<h3 title="{{GetYear .AddTime}}"><span class="date">{{ShowMonthDay .AddTime}}</span><a href="/read/{{.Id}}">{{.TitleHtml}}</a></h3>
                {{else}}<span>数据为空...</span>
                {{end}}
            </div>

            <!-- 分页 -->
            {{Pager .Data.CurrentPage .Data.PageNum "/archive?"}}

        </div>

    </div>
</div>

{{template "inc_footer" .}}

<script type="application/javascript" src="/js/jquery.pagination.js"></script>
<script>
    year = "";
    $('#archive-cloud').find("h3").each(function (i,obj) {
        curent_year = $(obj).attr("title");
        if(year!==curent_year){
            $(obj).before("<h2>"+curent_year+"</h2>");
            year = curent_year;
        }
    });

</script>
</body>
</html>